/*

 * LineProps2.java

 *

 * Created on 5. april 2002, 23:22

 */
package no.uib.jexpress_modularized.core.visualization.charts.GUI;

import java.io.Serializable;
import no.uib.jexpress_modularized.core.visualization.ColorButton;
import no.uib.jexpress_modularized.core.visualization.DoubleField;
import no.uib.jexpress_modularized.core.visualization.JEPanel;
import no.uib.jexpress_modularized.core.visualization.WholeNumberField;

/**
 *
 *
 *
 * @author bjarte dysvik
 *
 */
public class LineProps2 extends javax.swing.JDialog implements Serializable{

    /**
     * Creates new form LineProps2
     */
    public LineProps2(java.awt.Frame parent, boolean modal) {

        super(parent, modal);

        initComponents();

    }

    /**
     * This method is called from within the constructor to
     *
     * initialize the form.
     *
     * WARNING: Do NOT modify this code. The content of this method is
     *
     * always regenerated by the Form Editor.
     *
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        java.awt.GridBagConstraints gridBagConstraints;

        jButton2 = new javax.swing.JButton();
        buttonGroup1 = new javax.swing.ButtonGroup();
        jEPanel1 = new JEPanel();
        Fillpanel = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        SbgSV = new javax.swing.JComboBox();
        titlepanel = new javax.swing.JPanel();
        lineSizeSV = new WholeNumberField();
        gridpanel = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        gridColorSV = new ColorButton();
        paintGridSV = new javax.swing.JCheckBox();
        jLabel31 = new javax.swing.JLabel();
        transparencySV = new javax.swing.JSlider();
        axispanel = new javax.swing.JPanel();
        jPanel1 = new javax.swing.JPanel();
        jLabel6 = new javax.swing.JLabel();
        Xaxis = new javax.swing.JTextField();
        jLabel61 = new javax.swing.JLabel();
        xticsbothsidesSV = new javax.swing.JCheckBox();
        jLabel612 = new javax.swing.JLabel();
        RotXlabelsSV = new javax.swing.JCheckBox();
        jPanel11 = new javax.swing.JPanel();
        jLabel62 = new javax.swing.JLabel();
        Yaxis = new javax.swing.JTextField();
        jLabel611 = new javax.swing.JLabel();
        yticsbothsidesSV = new javax.swing.JCheckBox();
        miyticsSV = new WholeNumberField();
        jLabel711 = new javax.swing.JLabel();
        jPanel2 = new javax.swing.JPanel();
        jPanel31 = new javax.swing.JPanel();
        jLabel91 = new javax.swing.JLabel();
        jLabel911 = new javax.swing.JLabel();
        jPanel5 = new javax.swing.JPanel();
        copy = new javax.swing.JButton();
        defaults = new javax.swing.JButton();
        jSeparator1 = new javax.swing.JSeparator();
        ok = new javax.swing.JButton();
        close = new javax.swing.JButton();
        ChartBackground = new javax.swing.JPanel();
        jLabel211 = new javax.swing.JLabel();
        chartbgSV = new ColorButton();
        jLabel21 = new javax.swing.JLabel();
        AxisColorSV = new ColorButton();
        jPanel4 = new javax.swing.JPanel();
        singlecolorpanel = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        singlebgSV = new ColorButton();
        gradientpanel = new javax.swing.JPanel();
        jLabel4 = new javax.swing.JLabel();
        grad1SV = new ColorButton();
        jLabel41 = new javax.swing.JLabel();
        grad2SV = new ColorButton();
        jLabel5 = new javax.swing.JLabel();
        gradtypeSV = new javax.swing.JComboBox();
        picturepanel = new javax.swing.JPanel();
        pathSV = new javax.swing.JTextField();
        jLabel122212 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jPanel32 = new javax.swing.JPanel();
        stretchSV = new javax.swing.JRadioButton();
        tileSV = new javax.swing.JRadioButton();
        titlepanel1 = new javax.swing.JPanel();
        HeaderPanel = new javax.swing.JPanel();
        Header = new javax.swing.JTextField();
        titlepanel2 = new javax.swing.JPanel();
        minHeightSV = new WholeNumberField();
        jLabel8 = new javax.swing.JLabel();
        mixsizeSV = new WholeNumberField();
        jLabel81 = new javax.swing.JLabel();
        titlepanel3 = new javax.swing.JPanel();
        paintShadowsSV = new javax.swing.JCheckBox();
        jPanel3 = new javax.swing.JPanel();
        ShadowTransSV = new javax.swing.JCheckBox();
        jLabel9 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        ShadowColorSV = new ColorButton();
        valuesx = new javax.swing.JPanel();
        jLabel221 = new javax.swing.JLabel();
        jLabel23 = new javax.swing.JLabel();
        jSeparator2 = new javax.swing.JSeparator();
        ymin = new DoubleField();
        ymax = new DoubleField();
        endlabelsSV = new javax.swing.JCheckBox();
        reset = new javax.swing.JButton();

        jButton2.setText("jButton2");
        jButton2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton2ActionPerformed(evt);
            }
        });

        setTitle("Plot Properties");
        setModal(true);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                closeDialog(evt);
            }
        });

        jEPanel1.setLayout(new java.awt.GridBagLayout());

        jEPanel1.setPaintText(false);
        Fillpanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Fill", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP));
        Fillpanel.setOpaque(false);
        jLabel1.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel1.setText("Chart Area");
        Fillpanel.add(jLabel1);

        SbgSV.setMaximumSize(new java.awt.Dimension(32767, 20));
        SbgSV.setMinimumSize(new java.awt.Dimension(126, 20));
        SbgSV.setPreferredSize(new java.awt.Dimension(130, 20));
        SbgSV.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                SbgSVActionPerformed(evt);
            }
        });

        Fillpanel.add(SbgSV);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jEPanel1.add(Fillpanel, gridBagConstraints);

        titlepanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Line Size", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP));
        titlepanel.setOpaque(false);
        lineSizeSV.setBackground(new java.awt.Color(202, 220, 202));
        lineSizeSV.setColumns(4);
        lineSizeSV.setText("1");
        lineSizeSV.setPreferredSize(new java.awt.Dimension(48, 17));
        titlepanel.add(lineSizeSV);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jEPanel1.add(titlepanel, gridBagConstraints);

        gridpanel.setLayout(new java.awt.GridBagLayout());

        gridpanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Grid", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP));
        gridpanel.setOpaque(false);
        jLabel3.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel3.setText("Grid Color");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
        gridpanel.add(jLabel3, gridBagConstraints);

        gridColorSV.setColor(new java.awt.Color(200, 200, 200));
        gridColorSV.setMaximumSize(new java.awt.Dimension(15, 15));
        gridColorSV.setMinimumSize(new java.awt.Dimension(15, 15));
        gridColorSV.setPreferredSize(new java.awt.Dimension(18, 15));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 2;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 8);
        gridpanel.add(gridColorSV, gridBagConstraints);

        paintGridSV.setFont(new java.awt.Font("Dialog", 0, 12));
        paintGridSV.setText("Paint Grid");
        paintGridSV.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridpanel.add(paintGridSV, gridBagConstraints);

        jLabel31.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel31.setText("Grid Transparency");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.VERTICAL;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
        gridpanel.add(jLabel31, gridBagConstraints);

        transparencySV.setMajorTickSpacing(10);
        transparencySV.setMaximum(254);
        transparencySV.setInverted(true);
        transparencySV.setOpaque(false);
        transparencySV.setPreferredSize(new java.awt.Dimension(250, 25));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.gridwidth = 2;
        gridpanel.add(transparencySV, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jEPanel1.add(gridpanel, gridBagConstraints);

        axispanel.setLayout(new java.awt.GridLayout(2, 1, 4, 0));

        axispanel.setOpaque(false);
        jPanel1.setLayout(new java.awt.GridBagLayout());

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "X Axis", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP));
        jPanel1.setPreferredSize(new java.awt.Dimension(259, 70));
        jPanel1.setOpaque(false);
        jLabel6.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel6.setText("Title");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 1, 0, 3);
        jPanel1.add(jLabel6, gridBagConstraints);

        Xaxis.setBackground(new java.awt.Color(202, 202, 220));
        Xaxis.setMinimumSize(new java.awt.Dimension(160, 17));
        Xaxis.setPreferredSize(new java.awt.Dimension(160, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel1.add(Xaxis, gridBagConstraints);

        jLabel61.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel61.setText("Rotate Labels");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 1, 0, 3);
        jPanel1.add(jLabel61, gridBagConstraints);

        xticsbothsidesSV.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel1.add(xticsbothsidesSV, gridBagConstraints);

        jLabel612.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel612.setText("Tics in both Ends");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 1, 0, 3);
        jPanel1.add(jLabel612, gridBagConstraints);

        RotXlabelsSV.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel1.add(RotXlabelsSV, gridBagConstraints);

        axispanel.add(jPanel1);

        jPanel11.setLayout(new java.awt.GridBagLayout());

        jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Y Axis", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP));
        jPanel11.setOpaque(false);
        jLabel62.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel62.setText("Title");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
        jPanel11.add(jLabel62, gridBagConstraints);

        Yaxis.setBackground(new java.awt.Color(202, 202, 220));
        Yaxis.setMinimumSize(new java.awt.Dimension(160, 17));
        Yaxis.setPreferredSize(new java.awt.Dimension(160, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        jPanel11.add(Yaxis, gridBagConstraints);

        jLabel611.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel611.setText("Tics in both Ends");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
        jPanel11.add(jLabel611, gridBagConstraints);

        yticsbothsidesSV.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        jPanel11.add(yticsbothsidesSV, gridBagConstraints);

        miyticsSV.setBackground(new java.awt.Color(202, 220, 202));
        miyticsSV.setColumns(4);
        miyticsSV.setMinimumSize(new java.awt.Dimension(4, 17));
        miyticsSV.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(1, 0, 0, 0);
        jPanel11.add(miyticsSV, gridBagConstraints);

        jLabel711.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel711.setText("Minor Tics");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(1, 0, 0, 4);
        jPanel11.add(jLabel711, gridBagConstraints);

        axispanel.add(jPanel11);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.gridheight = 3;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jEPanel1.add(axispanel, gridBagConstraints);

        jPanel2.setLayout(new java.awt.BorderLayout());

        jPanel2.setBackground(new java.awt.Color(204, 204, 214));
        jPanel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(150, 150, 150)));
        jPanel31.setOpaque(false);
        jLabel91.setForeground(new java.awt.Color(200, 0, 0));
        jLabel91.setText("(!)");
        jPanel31.add(jLabel91);

        jLabel911.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel911.setForeground(new java.awt.Color(100, 100, 100));
        jLabel911.setText("May result in slow rendering");
        jPanel31.add(jLabel911);

        jPanel2.add(jPanel31, java.awt.BorderLayout.WEST);

        jPanel5.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT, 2, 2));

        jPanel5.setOpaque(false);
        copy.setBackground(new java.awt.Color(204, 204, 214));
        copy.setFont(new java.awt.Font("Dialog", 0, 12));
        copy.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons/paste.gif")));
        copy.setToolTipText("Copy Chart Image to Clipboard");
        copy.setPreferredSize(new java.awt.Dimension(47, 26));
        copy.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                copyActionPerformed(evt);
            }
        });

        jPanel5.add(copy);

        defaults.setBackground(new java.awt.Color(204, 204, 214));
        defaults.setFont(new java.awt.Font("Dialog", 0, 12));
        defaults.setText("Set Defaults");
        defaults.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                defaultsActionPerformed(evt);
            }
        });

        jPanel5.add(defaults);

        jSeparator1.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jSeparator1.setPreferredSize(new java.awt.Dimension(10, 22));
        jPanel5.add(jSeparator1);

        ok.setBackground(new java.awt.Color(204, 204, 214));
        ok.setFont(new java.awt.Font("Dialog", 0, 12));
        ok.setText("Ok");
        jPanel5.add(ok);

        close.setBackground(new java.awt.Color(204, 204, 214));
        close.setFont(new java.awt.Font("Dialog", 0, 12));
        close.setText("Close");
        close.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                closeActionPerformed(evt);
            }
        });

        jPanel5.add(close);

        jPanel2.add(jPanel5, java.awt.BorderLayout.CENTER);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 7;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        jEPanel1.add(jPanel2, gridBagConstraints);

        ChartBackground.setLayout(new java.awt.GridBagLayout());

        ChartBackground.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Chart & Axis Color", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP));
        ChartBackground.setOpaque(false);
        jLabel211.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel211.setText("Chart Color");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
        ChartBackground.add(jLabel211, gridBagConstraints);

        chartbgSV.setColor(new java.awt.Color(209, 202, 202));
        chartbgSV.setMaximumSize(new java.awt.Dimension(15, 15));
        chartbgSV.setMinimumSize(new java.awt.Dimension(15, 15));
        chartbgSV.setPreferredSize(new java.awt.Dimension(18, 15));
        ChartBackground.add(chartbgSV, new java.awt.GridBagConstraints());

        jLabel21.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel21.setText("Axis Color");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
        ChartBackground.add(jLabel21, gridBagConstraints);

        AxisColorSV.setColor(new java.awt.Color(209, 202, 202));
        AxisColorSV.setMaximumSize(new java.awt.Dimension(15, 15));
        AxisColorSV.setMinimumSize(new java.awt.Dimension(15, 15));
        AxisColorSV.setPreferredSize(new java.awt.Dimension(18, 15));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        ChartBackground.add(AxisColorSV, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jEPanel1.add(ChartBackground, gridBagConstraints);

        jPanel4.setLayout(new java.awt.CardLayout());

        jPanel4.setOpaque(false);
        singlecolorpanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Single Color Background", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP));
        singlecolorpanel.setOpaque(false);
        jLabel2.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel2.setText("Single Background Color");
        singlecolorpanel.add(jLabel2);

        singlebgSV.setColor(new java.awt.Color(209, 202, 202));
        singlebgSV.setMaximumSize(new java.awt.Dimension(15, 15));
        singlebgSV.setMinimumSize(new java.awt.Dimension(15, 15));
        singlebgSV.setPreferredSize(new java.awt.Dimension(15, 15));
        singlecolorpanel.add(singlebgSV);

        jPanel4.add(singlecolorpanel, "card1");

        gradientpanel.setLayout(new java.awt.GridBagLayout());

        gradientpanel.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Gradient Background", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP));
        gradientpanel.setOpaque(false);
        jLabel4.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel4.setText("Color 1");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 2);
        gradientpanel.add(jLabel4, gridBagConstraints);

        grad1SV.setMaximumSize(new java.awt.Dimension(15, 15));
        grad1SV.setMinimumSize(new java.awt.Dimension(15, 15));
        grad1SV.setPreferredSize(new java.awt.Dimension(18, 15));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 15);
        gradientpanel.add(grad1SV, gridBagConstraints);

        jLabel41.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel41.setText("Color 2");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 2);
        gradientpanel.add(jLabel41, gridBagConstraints);

        grad2SV.setMaximumSize(new java.awt.Dimension(15, 15));
        grad2SV.setMinimumSize(new java.awt.Dimension(15, 15));
        grad2SV.setPreferredSize(new java.awt.Dimension(18, 15));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 15);
        gradientpanel.add(grad2SV, gridBagConstraints);

        jLabel5.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel5.setText("Gradient Type");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
        gradientpanel.add(jLabel5, gridBagConstraints);

        gradtypeSV.setMaximumSize(new java.awt.Dimension(32767, 20));
        gradtypeSV.setMinimumSize(new java.awt.Dimension(126, 20));
        gradtypeSV.setPreferredSize(new java.awt.Dimension(130, 20));
        gradientpanel.add(gradtypeSV, new java.awt.GridBagConstraints());

        jPanel4.add(gradientpanel, "card2");

        picturepanel.setLayout(new java.awt.GridBagLayout());

        picturepanel.setBorder(javax.swing.BorderFactory.createTitledBorder("Background Picture"));
        picturepanel.setOpaque(false);
        pathSV.setBackground(new java.awt.Color(202, 202, 220));
        pathSV.setFont(new java.awt.Font("Arial", 0, 12));
        pathSV.setPreferredSize(new java.awt.Dimension(210, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        picturepanel.add(pathSV, gridBagConstraints);

        jLabel122212.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel122212.setText("Picture Path");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
        picturepanel.add(jLabel122212, gridBagConstraints);

        jButton1.setFont(new java.awt.Font("Dialog", 0, 12));
        jButton1.setText("Select File");
        jButton1.setPreferredSize(new java.awt.Dimension(101, 24));
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        picturepanel.add(jButton1, gridBagConstraints);

        jPanel32.setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 5, 0));

        jPanel32.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(155, 155, 155)));
        jPanel32.setOpaque(false);
        buttonGroup1.add(stretchSV);
        stretchSV.setFont(new java.awt.Font("Dialog", 0, 12));
        stretchSV.setSelected(true);
        stretchSV.setText("Stretch");
        stretchSV.setOpaque(false);
        jPanel32.add(stretchSV);

        buttonGroup1.add(tileSV);
        tileSV.setFont(new java.awt.Font("Dialog", 0, 12));
        tileSV.setText("Tile");
        tileSV.setOpaque(false);
        jPanel32.add(tileSV);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 3;
        gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
        gridBagConstraints.insets = new java.awt.Insets(9, 0, 0, 0);
        picturepanel.add(jPanel32, gridBagConstraints);

        jPanel4.add(picturepanel, "card3");

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.gridheight = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jEPanel1.add(jPanel4, gridBagConstraints);

        titlepanel1.setLayout(new java.awt.BorderLayout());

        titlepanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Chart Title", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP));
        titlepanel1.setOpaque(false);
        HeaderPanel.setLayout(new java.awt.BorderLayout());

        HeaderPanel.setBorder(javax.swing.BorderFactory.createEmptyBorder(2, 20, 2, 20));
        HeaderPanel.setOpaque(false);
        Header.setBackground(new java.awt.Color(202, 202, 220));
        Header.setPreferredSize(new java.awt.Dimension(4, 17));
        HeaderPanel.add(Header, java.awt.BorderLayout.CENTER);

        titlepanel1.add(HeaderPanel, java.awt.BorderLayout.NORTH);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jEPanel1.add(titlepanel1, gridBagConstraints);

        titlepanel2.setLayout(new java.awt.GridBagLayout());

        titlepanel2.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Chart Size", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP));
        titlepanel2.setOpaque(false);
        minHeightSV.setBackground(new java.awt.Color(202, 220, 202));
        minHeightSV.setColumns(4);
        minHeightSV.setText("300");
        minHeightSV.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 0);
        titlepanel2.add(minHeightSV, gridBagConstraints);

        jLabel8.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel8.setText("Minimum Width");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 1;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
        titlepanel2.add(jLabel8, gridBagConstraints);

        mixsizeSV.setBackground(new java.awt.Color(202, 220, 202));
        mixsizeSV.setColumns(4);
        mixsizeSV.setText("1");
        mixsizeSV.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 1;
        gridBagConstraints.gridy = 1;
        titlepanel2.add(mixsizeSV, gridBagConstraints);

        jLabel81.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel81.setText("Minimum Height");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 1, 4);
        titlepanel2.add(jLabel81, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 5;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jEPanel1.add(titlepanel2, gridBagConstraints);

        titlepanel3.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Unselected Rows", javax.swing.border.TitledBorder.LEFT, javax.swing.border.TitledBorder.TOP));
        titlepanel3.setOpaque(false);
        paintShadowsSV.setFont(new java.awt.Font("Dialog", 0, 12));
        paintShadowsSV.setText("Paint");
        paintShadowsSV.setOpaque(false);
        titlepanel3.add(paintShadowsSV);

        jPanel3.setLayout(new java.awt.BorderLayout());

        jPanel3.setOpaque(false);
        ShadowTransSV.setFont(new java.awt.Font("Dialog", 0, 12));
        ShadowTransSV.setText("Transparency");
        ShadowTransSV.setMargin(new java.awt.Insets(2, 2, 0, 0));
        ShadowTransSV.setOpaque(false);
        jPanel3.add(ShadowTransSV, java.awt.BorderLayout.CENTER);

        jLabel9.setForeground(new java.awt.Color(200, 0, 0));
        jLabel9.setText("(!)");
        jPanel3.add(jLabel9, java.awt.BorderLayout.EAST);

        titlepanel3.add(jPanel3);

        jLabel7.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel7.setText("Color");
        titlepanel3.add(jLabel7);

        ShadowColorSV.setColor(new java.awt.Color(209, 202, 202));
        ShadowColorSV.setMaximumSize(new java.awt.Dimension(15, 15));
        ShadowColorSV.setMinimumSize(new java.awt.Dimension(15, 15));
        ShadowColorSV.setPreferredSize(new java.awt.Dimension(18, 15));
        titlepanel3.add(ShadowColorSV);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 4;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jEPanel1.add(titlepanel3, gridBagConstraints);

        valuesx.setLayout(new java.awt.GridBagLayout());

        valuesx.setBorder(javax.swing.BorderFactory.createTitledBorder("Axis Value Span"));
        valuesx.setOpaque(false);
        jLabel221.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel221.setText("YMin");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 5;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 2);
        valuesx.add(jLabel221, gridBagConstraints);

        jLabel23.setFont(new java.awt.Font("Dialog", 0, 12));
        jLabel23.setText("YMax");
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 7;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 3, 2);
        valuesx.add(jLabel23, gridBagConstraints);

        jSeparator2.setOrientation(javax.swing.SwingConstants.VERTICAL);
        jSeparator2.setPreferredSize(new java.awt.Dimension(2, 20));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 9;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 4, 3, 7);
        valuesx.add(jSeparator2, gridBagConstraints);

        ymin.setBackground(new java.awt.Color(245, 245, 255));
        ymin.setColumns(4);
        ymin.setMinimumSize(new java.awt.Dimension(4, 17));
        ymin.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 6;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 7);
        valuesx.add(ymin, gridBagConstraints);

        ymax.setBackground(new java.awt.Color(245, 245, 255));
        ymax.setColumns(4);
        ymax.setMinimumSize(new java.awt.Dimension(4, 17));
        ymax.setPreferredSize(new java.awt.Dimension(48, 17));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 8;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 7);
        valuesx.add(ymax, gridBagConstraints);

        endlabelsSV.setFont(new java.awt.Font("Dialog", 0, 12));
        endlabelsSV.setText("Force Endlabels");
        endlabelsSV.setOpaque(false);
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 10;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 0);
        valuesx.add(endlabelsSV, gridBagConstraints);

        reset.setFont(new java.awt.Font("Dialog", 0, 12));
        reset.setText("Reset");
        reset.setMargin(new java.awt.Insets(2, 2, 2, 2));
        reset.setPreferredSize(new java.awt.Dimension(67, 22));
        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 11;
        gridBagConstraints.gridy = 0;
        gridBagConstraints.insets = new java.awt.Insets(0, 0, 4, 0);
        valuesx.add(reset, gridBagConstraints);

        gridBagConstraints = new java.awt.GridBagConstraints();
        gridBagConstraints.gridx = 0;
        gridBagConstraints.gridy = 6;
        gridBagConstraints.gridwidth = 2;
        gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
        jEPanel1.add(valuesx, gridBagConstraints);

        getContentPane().add(jEPanel1, java.awt.BorderLayout.CENTER);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void copyActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_copyActionPerformed
    }//GEN-LAST:event_copyActionPerformed

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed

        javax.swing.JFileChooser chooser = new javax.swing.JFileChooser();

        //NOTE: this line is not commented out in JExpress. Should it really be commented out here?
        chooser.setFileFilter(new ImageFilter());



        int returnVal = chooser.showOpenDialog(null);

        if (returnVal == javax.swing.JFileChooser.APPROVE_OPTION) {



            pathSV.setText(chooser.getSelectedFile().getAbsolutePath());

        }

    }//GEN-LAST:event_jButton1ActionPerformed

    private void defaultsActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_defaultsActionPerformed
        // Add your handling code here:
    }//GEN-LAST:event_defaultsActionPerformed

    private void closeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_closeActionPerformed

        setVisible(false);

    }//GEN-LAST:event_closeActionPerformed

    private void SbgSVActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_SbgSVActionPerformed

        if (SbgSV.getSelectedItem().equals("One Color")) {
            ((java.awt.CardLayout) jPanel4.getLayout()).show(jPanel4, "card1");
        } else if (SbgSV.getSelectedItem().equals("Gradient")) {
            ((java.awt.CardLayout) jPanel4.getLayout()).show(jPanel4, "card2");
        } else if (SbgSV.getSelectedItem().equals("External Picture")) {
            ((java.awt.CardLayout) jPanel4.getLayout()).show(jPanel4, "card3");
        }

    }//GEN-LAST:event_SbgSVActionPerformed

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton2ActionPerformed
        // Add your handling code here:
    }//GEN-LAST:event_jButton2ActionPerformed

    /**
     * Closes the dialog
     */
    private void closeDialog(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_closeDialog

        setVisible(false);

        dispose();

    }//GEN-LAST:event_closeDialog

    /**
     *
     * @param args the command line arguments
     *
     */
    public static void main(String args[]) {

        new LineProps2(new javax.swing.JFrame(), true).setVisible(true);

    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    public ColorButton AxisColorSV;
    private javax.swing.JPanel ChartBackground;
    private javax.swing.JPanel Fillpanel;
    public javax.swing.JTextField Header;
    public javax.swing.JPanel HeaderPanel;
    public javax.swing.JCheckBox RotXlabelsSV;
    public javax.swing.JComboBox SbgSV;
    public ColorButton ShadowColorSV;
    public javax.swing.JCheckBox ShadowTransSV;
    public javax.swing.JTextField Xaxis;
    public javax.swing.JTextField Yaxis;
    private javax.swing.JPanel axispanel;
    private javax.swing.ButtonGroup buttonGroup1;
    public ColorButton chartbgSV;
    public javax.swing.JButton close;
    public javax.swing.JButton copy;
    public javax.swing.JButton defaults;
    public javax.swing.JCheckBox endlabelsSV;
    public ColorButton grad1SV;
    public ColorButton grad2SV;
    private javax.swing.JPanel gradientpanel;
    public javax.swing.JComboBox gradtypeSV;
    public ColorButton gridColorSV;
    private javax.swing.JPanel gridpanel;
    public javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private JEPanel jEPanel1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel122212;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel211;
    private javax.swing.JLabel jLabel221;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel41;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel61;
    private javax.swing.JLabel jLabel611;
    private javax.swing.JLabel jLabel612;
    private javax.swing.JLabel jLabel62;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel711;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel81;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JLabel jLabel91;
    private javax.swing.JLabel jLabel911;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel31;
    public javax.swing.JPanel jPanel32;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JSeparator jSeparator2;
    public WholeNumberField lineSizeSV;
    public WholeNumberField minHeightSV;
    public WholeNumberField mixsizeSV;
    public WholeNumberField miyticsSV;
    public javax.swing.JButton ok;
    public javax.swing.JCheckBox paintGridSV;
    public javax.swing.JCheckBox paintShadowsSV;
    public javax.swing.JTextField pathSV;
    private javax.swing.JPanel picturepanel;
    public javax.swing.JButton reset;
    public ColorButton singlebgSV;
    private javax.swing.JPanel singlecolorpanel;
    public javax.swing.JRadioButton stretchSV;
    public javax.swing.JRadioButton tileSV;
    private javax.swing.JPanel titlepanel;
    private javax.swing.JPanel titlepanel1;
    private javax.swing.JPanel titlepanel2;
    private javax.swing.JPanel titlepanel3;
    public javax.swing.JSlider transparencySV;
    private javax.swing.JPanel valuesx;
    public javax.swing.JCheckBox xticsbothsidesSV;
    public DoubleField ymax;
    public DoubleField ymin;
    public javax.swing.JCheckBox yticsbothsidesSV;
    // End of variables declaration//GEN-END:variables

    private static class ImageFilter extends javax.swing.filechooser.FileFilter {

        // Accept all directories and all gif, jpg, or tiff files.
        @Override
        public boolean accept(java.io.File f) {

            if (f.isDirectory()) {

                return true;

            }



            String extension = Utils.getExtension(f);

            if (extension != null) {

                if (extension.equals(Utils.tiff)
                        || extension.equals(Utils.tif)
                        || extension.equals(Utils.gif)
                        || extension.equals(Utils.jpeg)
                        || extension.equals(Utils.jpg)
                        || extension.equals(Utils.png)) {

                    return true;

                } else {

                    return false;

                }

            }



            return false;

        }

        // The description of this filter
        @Override
        public String getDescription() {

            return "Just Images";

        }
    } //end inner-class ImageFilter

    private static class Utils {

        public final static String jpeg = "jpeg";
        public final static String jpg = "jpg";
        public final static String gif = "gif";
        public final static String tiff = "tiff";
        public final static String tif = "tif";
        public final static String png = "png";

        /*
         *
         * Get the extension of a file.
         *
         */
        public static String getExtension(java.io.File f) {

            String ext = null;

            String s = f.getName();

            int i = s.lastIndexOf('.');



            if (i > 0 && i < s.length() - 1) {

                ext = s.substring(i + 1).toLowerCase();

            }

            return ext;

        }
    } //end inner-class Utils
    
}
